package com.weu.service.impl;

import com.weu.bean.Car;
import com.weu.mapper.CarMapper;
import com.weu.service.ICarService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CarServiceImpl implements ICarService {

    @Resource
    private CarMapper carMapper;

    @Override
    public List<Car> getAll() {
        return carMapper.getAll();
    }

    @Override
    public Car getOne(int id) {
        return carMapper.getOne(id);
    }

    @Override
    public Car getByCarModelId(int id) {
        return carMapper.getByCarModelId(id);
    }

    @Override
    public int delById(int id) {
        return carMapper.delById(id);
    }

    @Override
    public int updateCar(Car car) {
        return carMapper.updateCar(car);
    }

    @Override
    public int saveCar(Car car) {
        return carMapper.saveCar(car);
    }
}
